package app.util.image.action
{
	import app.util.*;
	
	import flash.display.*;
	import flash.filters.ConvolutionFilter;
	import flash.geom.*;
	
	public class SharpenAction extends AbstractAction
	{		
		public override function getDescription():String
		{
			return "Sharpening";
		}
		
		public override function getActionedBitmapData():BitmapData
		{
			var old:BitmapData = Mediator.getCurrentBitmapData();
			var ret:BitmapData = old.clone();
			var filter:ConvolutionFilter = new ConvolutionFilter(3, 3, 
				[
				 0, -1, 0,
				-1,  5, -1, 
 				 0, -1, 0,
				]);
			ret.applyFilter(ret, ret.rect, new Point(0, 0), filter);
			return ret;
		}
	}
}